<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\models\User;
class AuthController extends Controller
{
    public function index(){
        return view('index');
        
    }
    public function login(){
        return view('login');
    }
    public function do_login(Request $request){
        
        $token = $request->input('token');
        session(['admin'=>$token]);
        $res = $this->login_token($token);
        session(['admin_info'=>$res]);
    }
    public function regist(){
        return view('regist');
    }
    public function logout(Request $request){
        $request->session()->flush();  //清空所有数据
        return redirect('/');
    }


}
